package Base;

import com.alibaba.fastjson.JSON;

/**
 * Json转换工具类
 * User: 张惺钰
 * Date: 9/15/15
 * Time: 2:41 PM
 */
@SuppressWarnings("unused")
public class JsonUtils {

    public static <T> String toJson(T obj) {
        return JSON.toJSONString(obj);
    }

    public static <T> T toObject(String jsonStr, Class<T> cls) {
        return JSON.parseObject(jsonStr, cls);
    }

}
